\(\int \cos ^4(c+d x) \cot ^2(c+d x) (a+b \sin (c+d x))^2 \, dx\) [1245]

   Optimal result
   Rubi [A] (verified)
   Mathematica [A] (verified)
   Maple [A] (verified)
   Fricas [A] (verification not implemented)
   Sympy [F(-1)]
   Maxima [A] (verification not implemented)
   Giac [B] (verification not implemented)
   Mupad [B] (verification not implemented)

Optimal result

Integrand size = 29, antiderivative size = 178 \[ \int \cos ^4(c+d x) \cot ^2(c+d x) (a+b \sin (c+d x))^2 \, dx=-\frac {5}{16} \left (6 a^2-b^2\right ) x-\frac {2 a b \text {arctanh}(\cos (c+d x))}{d}+\frac {2 a b \cos (c+d x)}{d}+\frac {2 a b \cos ^3(c+d x)}{3 d}+\frac {2 a b \cos ^5(c+d x)}{5 d}-\frac {a^2 \cot (c+d x)}{d}-\frac {\left (14 a^2-5 b^2\right ) \cos (c+d x) \sin (c+d x)}{16 d}-\frac {\left (6 a^2-5 b^2\right ) \cos ^3(c+d x) \sin (c+d x)}{24 d}+\frac {b^2 \cos ^5(c+d x) \sin (c+d x)}{6 d} \]

[Out]

-5/16*(6*a^2-b^2)*x-2*a*b*arctanh(cos(d*x+c))/d+2*a*b*cos(d*x+c)/d+2/3*a*b*cos(d*x+c)^3/d+2/5*a*b*cos(d*x+c)^5
/d-a^2*cot(d*x+c)/d-1/16*(14*a^2-5*b^2)*cos(d*x+c)*sin(d*x+c)/d-1/24*(6*a^2-5*b^2)*cos(d*x+c)^3*sin(d*x+c)/d+1
/6*b^2*cos(d*x+c)^5*sin(d*x+c)/d

Rubi [A] (verified)

Time = 0.33 (sec) , antiderivative size = 178, normalized size of antiderivative = 1.00, number of steps used = 12, number of rules used = 8, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.276, Rules used = {2990, 2672, 308, 212, 445, 467, 464, 209} \[ \int \cos ^4(c+d x) \cot ^2(c+d x) (a+b \sin (c+d x))^2 \, dx=-\frac {\left (6 a^2-5 b^2\right ) \sin (c+d x) \cos ^3(c+d x)}{24 d}-\frac {\left (14 a^2-5 b^2\right ) \sin (c+d x) \cos (c+d x)}{16 d}-\frac {5}{16} x \left (6 a^2-b^2\right )-\frac {a^2 \cot (c+d x)}{d}-\frac {2 a b \text {arctanh}(\cos (c+d x))}{d}+\frac {2 a b \cos ^5(c+d x)}{5 d}+\frac {2 a b \cos ^3(c+d x)}{3 d}+\frac {2 a b \cos (c+d x)}{d}+\frac {b^2 \sin (c+d x) \cos ^5(c+d x)}{6 d} \]

[In]

Int[Cos[c + d*x]^4*Cot[c + d*x]^2*(a + b*Sin[c + d*x])^2,x]

[Out]

(-5*(6*a^2 - b^2)*x)/16 - (2*a*b*ArcTanh[Cos[c + d*x]])/d + (2*a*b*Cos[c + d*x])/d + (2*a*b*Cos[c + d*x]^3)/(3
*d) + (2*a*b*Cos[c + d*x]^5)/(5*d) - (a^2*Cot[c + d*x])/d - ((14*a^2 - 5*b^2)*Cos[c + d*x]*Sin[c + d*x])/(16*d
) - ((6*a^2 - 5*b^2)*Cos[c + d*x]^3*Sin[c + d*x])/(24*d) + (b^2*Cos[c + d*x]^5*Sin[c + d*x])/(6*d)

Rule 209

Int[((a_) + (b_.)*(x_)^2)^(-1), x_Symbol] :> Simp[(1/(Rt[a, 2]*Rt[b, 2]))*ArcTan[Rt[b, 2]*(x/Rt[a, 2])], x] /;
 FreeQ[{a, b}, x] && PosQ[a/b] && (GtQ[a, 0] || GtQ[b, 0])

Rule 212

Int[((a_) + (b_.)*(x_)^2)^(-1), x_Symbol] :> Simp[(1/(Rt[a, 2]*Rt[-b, 2]))*ArcTanh[Rt[-b, 2]*(x/Rt[a, 2])], x]
 /; FreeQ[{a, b}, x] && NegQ[a/b] && (GtQ[a, 0] || LtQ[b, 0])

Rule 308

Int[(x_)^(m_)/((a_) + (b_.)*(x_)^(n_)), x_Symbol] :> Int[PolynomialDivide[x^m, a + b*x^n, x], x] /; FreeQ[{a,
b}, x] && IGtQ[m, 0] && IGtQ[n, 0] && GtQ[m, 2*n - 1]

Rule 445

Int[((c_) + (d_.)*(x_)^(mn_.))^(q_.)*((a_) + (b_.)*(x_)^(n_.))^(p_.), x_Symbol] :> Int[(a + b*x^n)^p*((d + c*x
^n)^q/x^(n*q)), x] /; FreeQ[{a, b, c, d, n, p}, x] && EqQ[mn, -n] && IntegerQ[q] && (PosQ[n] ||  !IntegerQ[p])

Rule 464

Int[((e_.)*(x_))^(m_.)*((a_) + (b_.)*(x_)^(n_))^(p_.)*((c_) + (d_.)*(x_)^(n_)), x_Symbol] :> Simp[c*(e*x)^(m +
 1)*((a + b*x^n)^(p + 1)/(a*e*(m + 1))), x] + Dist[(a*d*(m + 1) - b*c*(m + n*(p + 1) + 1))/(a*e^n*(m + 1)), In
t[(e*x)^(m + n)*(a + b*x^n)^p, x], x] /; FreeQ[{a, b, c, d, e, p}, x] && NeQ[b*c - a*d, 0] && (IntegerQ[n] ||
GtQ[e, 0]) && ((GtQ[n, 0] && LtQ[m, -1]) || (LtQ[n, 0] && GtQ[m + n, -1])) &&  !ILtQ[p, -1]

Rule 467

Int[(x_)^(m_)*((a_) + (b_.)*(x_)^2)^(p_)*((c_) + (d_.)*(x_)^2), x_Symbol] :> Simp[(-a)^(m/2 - 1)*(b*c - a*d)*x
*((a + b*x^2)^(p + 1)/(2*b^(m/2 + 1)*(p + 1))), x] + Dist[1/(2*b^(m/2 + 1)*(p + 1)), Int[x^m*(a + b*x^2)^(p +
1)*ExpandToSum[2*b*(p + 1)*Together[(b^(m/2)*(c + d*x^2) - (-a)^(m/2 - 1)*(b*c - a*d)*x^(-m + 2))/(a + b*x^2)]
 - ((-a)^(m/2 - 1)*(b*c - a*d))/x^m, x], x], x] /; FreeQ[{a, b, c, d}, x] && NeQ[b*c - a*d, 0] && LtQ[p, -1] &
& ILtQ[m/2, 0] && (IntegerQ[p] || EqQ[m + 2*p + 1, 0])

Rule 2672

Int[((a_.)*sin[(e_.) + (f_.)*(x_)])^(m_.)*tan[(e_.) + (f_.)*(x_)]^(n_.), x_Symbol] :> With[{ff = FreeFactors[S
in[e + f*x], x]}, Dist[ff/f, Subst[Int[(ff*x)^(m + n)/(a^2 - ff^2*x^2)^((n + 1)/2), x], x, a*(Sin[e + f*x]/ff)
], x]] /; FreeQ[{a, e, f, m}, x] && IntegerQ[(n + 1)/2]

Rule 2990

Int[(cos[(e_.) + (f_.)*(x_)]*(g_.))^(p_)*((d_.)*sin[(e_.) + (f_.)*(x_)])^(n_)*((a_) + (b_.)*sin[(e_.) + (f_.)*
(x_)])^2, x_Symbol] :> Dist[2*a*(b/d), Int[(g*Cos[e + f*x])^p*(d*Sin[e + f*x])^(n + 1), x], x] + Int[(g*Cos[e
+ f*x])^p*(d*Sin[e + f*x])^n*(a^2 + b^2*Sin[e + f*x]^2), x] /; FreeQ[{a, b, d, e, f, g, n, p}, x] && NeQ[a^2 -
 b^2, 0]

Rubi steps \begin{align*} \text {integral}& = (2 a b) \int \cos ^5(c+d x) \cot (c+d x) \, dx+\int \cos ^4(c+d x) \cot ^2(c+d x) \left (a^2+b^2 \sin ^2(c+d x)\right ) \, dx \\ & = \frac {\text {Subst}\left (\int \frac {a^2+b^2+\frac {a^2}{x^2}}{\left (1+x^2\right )^4} \, dx,x,\tan (c+d x)\right )}{d}-\frac {(2 a b) \text {Subst}\left (\int \frac {x^6}{1-x^2} \, dx,x,\cos (c+d x)\right )}{d} \\ & = \frac {\text {Subst}\left (\int \frac {a^2+\left (a^2+b^2\right ) x^2}{x^2 \left (1+x^2\right )^4} \, dx,x,\tan (c+d x)\right )}{d}-\frac {(2 a b) \text {Subst}\left (\int \left (-1-x^2-x^4+\frac {1}{1-x^2}\right ) \, dx,x,\cos (c+d x)\right )}{d} \\ & = \frac {2 a b \cos (c+d x)}{d}+\frac {2 a b \cos ^3(c+d x)}{3 d}+\frac {2 a b \cos ^5(c+d x)}{5 d}+\frac {b^2 \cos ^5(c+d x) \sin (c+d x)}{6 d}-\frac {\text {Subst}\left (\int \frac {-6 a^2-5 b^2 x^2}{x^2 \left (1+x^2\right )^3} \, dx,x,\tan (c+d x)\right )}{6 d}-\frac {(2 a b) \text {Subst}\left (\int \frac {1}{1-x^2} \, dx,x,\cos (c+d x)\right )}{d} \\ & = -\frac {2 a b \text {arctanh}(\cos (c+d x))}{d}+\frac {2 a b \cos (c+d x)}{d}+\frac {2 a b \cos ^3(c+d x)}{3 d}+\frac {2 a b \cos ^5(c+d x)}{5 d}-\frac {\left (6 a^2-5 b^2\right ) \cos ^3(c+d x) \sin (c+d x)}{24 d}+\frac {b^2 \cos ^5(c+d x) \sin (c+d x)}{6 d}+\frac {\text {Subst}\left (\int \frac {24 a^2-3 \left (6 a^2-5 b^2\right ) x^2}{x^2 \left (1+x^2\right )^2} \, dx,x,\tan (c+d x)\right )}{24 d} \\ & = -\frac {2 a b \text {arctanh}(\cos (c+d x))}{d}+\frac {2 a b \cos (c+d x)}{d}+\frac {2 a b \cos ^3(c+d x)}{3 d}+\frac {2 a b \cos ^5(c+d x)}{5 d}-\frac {\left (14 a^2-5 b^2\right ) \cos (c+d x) \sin (c+d x)}{16 d}-\frac {\left (6 a^2-5 b^2\right ) \cos ^3(c+d x) \sin (c+d x)}{24 d}+\frac {b^2 \cos ^5(c+d x) \sin (c+d x)}{6 d}-\frac {\text {Subst}\left (\int \frac {-48 a^2+3 \left (14 a^2-5 b^2\right ) x^2}{x^2 \left (1+x^2\right )} \, dx,x,\tan (c+d x)\right )}{48 d} \\ & = -\frac {2 a b \text {arctanh}(\cos (c+d x))}{d}+\frac {2 a b \cos (c+d x)}{d}+\frac {2 a b \cos ^3(c+d x)}{3 d}+\frac {2 a b \cos ^5(c+d x)}{5 d}-\frac {a^2 \cot (c+d x)}{d}-\frac {\left (14 a^2-5 b^2\right ) \cos (c+d x) \sin (c+d x)}{16 d}-\frac {\left (6 a^2-5 b^2\right ) \cos ^3(c+d x) \sin (c+d x)}{24 d}+\frac {b^2 \cos ^5(c+d x) \sin (c+d x)}{6 d}-\frac {\left (5 \left (6 a^2-b^2\right )\right ) \text {Subst}\left (\int \frac {1}{1+x^2} \, dx,x,\tan (c+d x)\right )}{16 d} \\ & = -\frac {5}{16} \left (6 a^2-b^2\right ) x-\frac {2 a b \text {arctanh}(\cos (c+d x))}{d}+\frac {2 a b \cos (c+d x)}{d}+\frac {2 a b \cos ^3(c+d x)}{3 d}+\frac {2 a b \cos ^5(c+d x)}{5 d}-\frac {a^2 \cot (c+d x)}{d}-\frac {\left (14 a^2-5 b^2\right ) \cos (c+d x) \sin (c+d x)}{16 d}-\frac {\left (6 a^2-5 b^2\right ) \cos ^3(c+d x) \sin (c+d x)}{24 d}+\frac {b^2 \cos ^5(c+d x) \sin (c+d x)}{6 d} \\ \end{align*}

Mathematica [A] (verified)

Time = 0.38 (sec) , antiderivative size = 220, normalized size of antiderivative = 1.24 \[ \int \cos ^4(c+d x) \cot ^2(c+d x) (a+b \sin (c+d x))^2 \, dx=-\frac {15 a^2 (c+d x)}{8 d}+\frac {5 b^2 (c+d x)}{16 d}+\frac {11 a b \cos (c+d x)}{4 d}+\frac {7 a b \cos (3 (c+d x))}{24 d}+\frac {a b \cos (5 (c+d x))}{40 d}-\frac {a^2 \cot (c+d x)}{d}-\frac {2 a b \log \left (\cos \left (\frac {1}{2} (c+d x)\right )\right )}{d}+\frac {2 a b \log \left (\sin \left (\frac {1}{2} (c+d x)\right )\right )}{d}-\frac {a^2 \sin (2 (c+d x))}{2 d}+\frac {15 b^2 \sin (2 (c+d x))}{64 d}-\frac {a^2 \sin (4 (c+d x))}{32 d}+\frac {3 b^2 \sin (4 (c+d x))}{64 d}+\frac {b^2 \sin (6 (c+d x))}{192 d} \]

[In]

Integrate[Cos[c + d*x]^4*Cot[c + d*x]^2*(a + b*Sin[c + d*x])^2,x]

[Out]

(-15*a^2*(c + d*x))/(8*d) + (5*b^2*(c + d*x))/(16*d) + (11*a*b*Cos[c + d*x])/(4*d) + (7*a*b*Cos[3*(c + d*x)])/
(24*d) + (a*b*Cos[5*(c + d*x)])/(40*d) - (a^2*Cot[c + d*x])/d - (2*a*b*Log[Cos[(c + d*x)/2]])/d + (2*a*b*Log[S
in[(c + d*x)/2]])/d - (a^2*Sin[2*(c + d*x)])/(2*d) + (15*b^2*Sin[2*(c + d*x)])/(64*d) - (a^2*Sin[4*(c + d*x)])
/(32*d) + (3*b^2*Sin[4*(c + d*x)])/(64*d) + (b^2*Sin[6*(c + d*x)])/(192*d)

Maple [A] (verified)

Time = 0.61 (sec) , antiderivative size = 165, normalized size of antiderivative = 0.93

method result size
derivativedivides \(\frac {a^{2} \left (-\frac {\cos ^{7}\left (d x +c \right )}{\sin \left (d x +c \right )}-\left (\cos ^{5}\left (d x +c \right )+\frac {5 \left (\cos ^{3}\left (d x +c \right )\right )}{4}+\frac {15 \cos \left (d x +c \right )}{8}\right ) \sin \left (d x +c \right )-\frac {15 d x}{8}-\frac {15 c}{8}\right )+2 a b \left (\frac {\left (\cos ^{5}\left (d x +c \right )\right )}{5}+\frac {\left (\cos ^{3}\left (d x +c \right )\right )}{3}+\cos \left (d x +c \right )+\ln \left (\csc \left (d x +c \right )-\cot \left (d x +c \right )\right )\right )+b^{2} \left (\frac {\left (\cos ^{5}\left (d x +c \right )+\frac {5 \left (\cos ^{3}\left (d x +c \right )\right )}{4}+\frac {15 \cos \left (d x +c \right )}{8}\right ) \sin \left (d x +c \right )}{6}+\frac {5 d x}{16}+\frac {5 c}{16}\right )}{d}\) \(165\)
default \(\frac {a^{2} \left (-\frac {\cos ^{7}\left (d x +c \right )}{\sin \left (d x +c \right )}-\left (\cos ^{5}\left (d x +c \right )+\frac {5 \left (\cos ^{3}\left (d x +c \right )\right )}{4}+\frac {15 \cos \left (d x +c \right )}{8}\right ) \sin \left (d x +c \right )-\frac {15 d x}{8}-\frac {15 c}{8}\right )+2 a b \left (\frac {\left (\cos ^{5}\left (d x +c \right )\right )}{5}+\frac {\left (\cos ^{3}\left (d x +c \right )\right )}{3}+\cos \left (d x +c \right )+\ln \left (\csc \left (d x +c \right )-\cot \left (d x +c \right )\right )\right )+b^{2} \left (\frac {\left (\cos ^{5}\left (d x +c \right )+\frac {5 \left (\cos ^{3}\left (d x +c \right )\right )}{4}+\frac {15 \cos \left (d x +c \right )}{8}\right ) \sin \left (d x +c \right )}{6}+\frac {5 d x}{16}+\frac {5 c}{16}\right )}{d}\) \(165\)
parallelrisch \(\frac {1920 \ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )\right ) a b -600 \left (\cos \left (d x +c \right )-\frac {3 \cos \left (3 d x +3 c \right )}{16}-\frac {\cos \left (5 d x +5 c \right )}{80}\right ) \sec \left (\frac {d x}{2}+\frac {c}{2}\right ) a^{2} \csc \left (\frac {d x}{2}+\frac {c}{2}\right )-1800 a^{2} d x +300 b^{2} d x +2640 a b \cos \left (d x +c \right )+280 a b \cos \left (3 d x +3 c \right )+24 a b \cos \left (5 d x +5 c \right )+45 b^{2} \sin \left (4 d x +4 c \right )+5 b^{2} \sin \left (6 d x +6 c \right )+225 b^{2} \sin \left (2 d x +2 c \right )+2944 a b}{960 d}\) \(169\)
risch \(-\frac {15 a^{2} x}{8}+\frac {5 b^{2} x}{16}-\frac {i {\mathrm e}^{-2 i \left (d x +c \right )} a^{2}}{4 d}+\frac {15 i {\mathrm e}^{-2 i \left (d x +c \right )} b^{2}}{128 d}+\frac {11 a b \,{\mathrm e}^{i \left (d x +c \right )}}{8 d}+\frac {11 a b \,{\mathrm e}^{-i \left (d x +c \right )}}{8 d}-\frac {15 i {\mathrm e}^{2 i \left (d x +c \right )} b^{2}}{128 d}-\frac {2 i a^{2}}{d \left ({\mathrm e}^{2 i \left (d x +c \right )}-1\right )}+\frac {i {\mathrm e}^{2 i \left (d x +c \right )} a^{2}}{4 d}-\frac {2 a b \ln \left ({\mathrm e}^{i \left (d x +c \right )}+1\right )}{d}+\frac {2 a b \ln \left ({\mathrm e}^{i \left (d x +c \right )}-1\right )}{d}+\frac {\sin \left (6 d x +6 c \right ) b^{2}}{192 d}+\frac {a b \cos \left (5 d x +5 c \right )}{40 d}-\frac {\sin \left (4 d x +4 c \right ) a^{2}}{32 d}+\frac {3 \sin \left (4 d x +4 c \right ) b^{2}}{64 d}+\frac {7 a b \cos \left (3 d x +3 c \right )}{24 d}\) \(261\)
norman \(\frac {\left (-\frac {225 a^{2}}{8}+\frac {75 b^{2}}{16}\right ) x \left (\tan ^{5}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )+\left (-\frac {225 a^{2}}{8}+\frac {75 b^{2}}{16}\right ) x \left (\tan ^{9}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )+\left (-\frac {75 a^{2}}{2}+\frac {25 b^{2}}{4}\right ) x \left (\tan ^{7}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )+\left (-\frac {45 a^{2}}{4}+\frac {15 b^{2}}{8}\right ) x \left (\tan ^{3}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )+\left (-\frac {45 a^{2}}{4}+\frac {15 b^{2}}{8}\right ) x \left (\tan ^{11}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )+\left (-\frac {15 a^{2}}{8}+\frac {5 b^{2}}{16}\right ) x \tan \left (\frac {d x}{2}+\frac {c}{2}\right )+\left (-\frac {15 a^{2}}{8}+\frac {5 b^{2}}{16}\right ) x \left (\tan ^{13}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )+\frac {56 a b \left (\tan ^{5}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{d}-\frac {a^{2}}{2 d}+\frac {a^{2} \left (\tan ^{14}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{2 d}-\frac {5 \left (4 a^{2}-3 b^{2}\right ) \left (\tan ^{6}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{4 d}+\frac {5 \left (4 a^{2}-3 b^{2}\right ) \left (\tan ^{8}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{4 d}-\frac {\left (38 a^{2}-11 b^{2}\right ) \left (\tan ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{8 d}+\frac {\left (38 a^{2}-11 b^{2}\right ) \left (\tan ^{12}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{8 d}-\frac {\left (222 a^{2}+5 b^{2}\right ) \left (\tan ^{4}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{24 d}+\frac {\left (222 a^{2}+5 b^{2}\right ) \left (\tan ^{10}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{24 d}+\frac {12 a b \left (\tan ^{11}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{d}+\frac {36 a b \left (\tan ^{9}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{d}+\frac {184 a b \left (\tan ^{7}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{3 d}+\frac {124 a b \left (\tan ^{3}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{5 d}+\frac {92 a b \tan \left (\frac {d x}{2}+\frac {c}{2}\right )}{15 d}}{\left (1+\tan ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )^{6} \tan \left (\frac {d x}{2}+\frac {c}{2}\right )}+\frac {2 a b \ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{d}\) \(508\)

[In]

int(cos(d*x+c)^6*csc(d*x+c)^2*(a+b*sin(d*x+c))^2,x,method=_RETURNVERBOSE)

[Out]

1/d*(a^2*(-1/sin(d*x+c)*cos(d*x+c)^7-(cos(d*x+c)^5+5/4*cos(d*x+c)^3+15/8*cos(d*x+c))*sin(d*x+c)-15/8*d*x-15/8*
c)+2*a*b*(1/5*cos(d*x+c)^5+1/3*cos(d*x+c)^3+cos(d*x+c)+ln(csc(d*x+c)-cot(d*x+c)))+b^2*(1/6*(cos(d*x+c)^5+5/4*c
os(d*x+c)^3+15/8*cos(d*x+c))*sin(d*x+c)+5/16*d*x+5/16*c))

Fricas [A] (verification not implemented)

none

Time = 0.37 (sec) , antiderivative size = 188, normalized size of antiderivative = 1.06 \[ \int \cos ^4(c+d x) \cot ^2(c+d x) (a+b \sin (c+d x))^2 \, dx=-\frac {40 \, b^{2} \cos \left (d x + c\right )^{7} - 10 \, {\left (6 \, a^{2} - b^{2}\right )} \cos \left (d x + c\right )^{5} - 25 \, {\left (6 \, a^{2} - b^{2}\right )} \cos \left (d x + c\right )^{3} + 240 \, a b \log \left (\frac {1}{2} \, \cos \left (d x + c\right ) + \frac {1}{2}\right ) \sin \left (d x + c\right ) - 240 \, a b \log \left (-\frac {1}{2} \, \cos \left (d x + c\right ) + \frac {1}{2}\right ) \sin \left (d x + c\right ) + 75 \, {\left (6 \, a^{2} - b^{2}\right )} \cos \left (d x + c\right ) - {\left (96 \, a b \cos \left (d x + c\right )^{5} + 160 \, a b \cos \left (d x + c\right )^{3} - 75 \, {\left (6 \, a^{2} - b^{2}\right )} d x + 480 \, a b \cos \left (d x + c\right )\right )} \sin \left (d x + c\right )}{240 \, d \sin \left (d x + c\right )} \]

[In]

integrate(cos(d*x+c)^6*csc(d*x+c)^2*(a+b*sin(d*x+c))^2,x, algorithm="fricas")

[Out]

-1/240*(40*b^2*cos(d*x + c)^7 - 10*(6*a^2 - b^2)*cos(d*x + c)^5 - 25*(6*a^2 - b^2)*cos(d*x + c)^3 + 240*a*b*lo
g(1/2*cos(d*x + c) + 1/2)*sin(d*x + c) - 240*a*b*log(-1/2*cos(d*x + c) + 1/2)*sin(d*x + c) + 75*(6*a^2 - b^2)*
cos(d*x + c) - (96*a*b*cos(d*x + c)^5 + 160*a*b*cos(d*x + c)^3 - 75*(6*a^2 - b^2)*d*x + 480*a*b*cos(d*x + c))*
sin(d*x + c))/(d*sin(d*x + c))

Sympy [F(-1)]

Timed out. \[ \int \cos ^4(c+d x) \cot ^2(c+d x) (a+b \sin (c+d x))^2 \, dx=\text {Timed out} \]

[In]

integrate(cos(d*x+c)**6*csc(d*x+c)**2*(a+b*sin(d*x+c))**2,x)

[Out]

Timed out

Maxima [A] (verification not implemented)

none

Time = 0.29 (sec) , antiderivative size = 172, normalized size of antiderivative = 0.97 \[ \int \cos ^4(c+d x) \cot ^2(c+d x) (a+b \sin (c+d x))^2 \, dx=-\frac {120 \, {\left (15 \, d x + 15 \, c + \frac {15 \, \tan \left (d x + c\right )^{4} + 25 \, \tan \left (d x + c\right )^{2} + 8}{\tan \left (d x + c\right )^{5} + 2 \, \tan \left (d x + c\right )^{3} + \tan \left (d x + c\right )}\right )} a^{2} - 64 \, {\left (6 \, \cos \left (d x + c\right )^{5} + 10 \, \cos \left (d x + c\right )^{3} + 30 \, \cos \left (d x + c\right ) - 15 \, \log \left (\cos \left (d x + c\right ) + 1\right ) + 15 \, \log \left (\cos \left (d x + c\right ) - 1\right )\right )} a b + 5 \, {\left (4 \, \sin \left (2 \, d x + 2 \, c\right )^{3} - 60 \, d x - 60 \, c - 9 \, \sin \left (4 \, d x + 4 \, c\right ) - 48 \, \sin \left (2 \, d x + 2 \, c\right )\right )} b^{2}}{960 \, d} \]

[In]

integrate(cos(d*x+c)^6*csc(d*x+c)^2*(a+b*sin(d*x+c))^2,x, algorithm="maxima")

[Out]

-1/960*(120*(15*d*x + 15*c + (15*tan(d*x + c)^4 + 25*tan(d*x + c)^2 + 8)/(tan(d*x + c)^5 + 2*tan(d*x + c)^3 +
tan(d*x + c)))*a^2 - 64*(6*cos(d*x + c)^5 + 10*cos(d*x + c)^3 + 30*cos(d*x + c) - 15*log(cos(d*x + c) + 1) + 1
5*log(cos(d*x + c) - 1))*a*b + 5*(4*sin(2*d*x + 2*c)^3 - 60*d*x - 60*c - 9*sin(4*d*x + 4*c) - 48*sin(2*d*x + 2
*c))*b^2)/d

Giac [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 368 vs. \(2 (166) = 332\).

Time = 0.37 (sec) , antiderivative size = 368, normalized size of antiderivative = 2.07 \[ \int \cos ^4(c+d x) \cot ^2(c+d x) (a+b \sin (c+d x))^2 \, dx=\frac {480 \, a b \log \left ({\left | \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) \right |}\right ) + 120 \, a^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - 75 \, {\left (6 \, a^{2} - b^{2}\right )} {\left (d x + c\right )} - \frac {120 \, {\left (4 \, a b \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) + a^{2}\right )}}{\tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )} + \frac {2 \, {\left (270 \, a^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{11} - 165 \, b^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{11} + 1440 \, a b \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{10} + 570 \, a^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{9} + 25 \, b^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{9} + 4320 \, a b \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{8} + 300 \, a^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{7} - 450 \, b^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{7} + 7360 \, a b \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{6} - 300 \, a^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{5} + 450 \, b^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{5} + 6720 \, a b \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{4} - 570 \, a^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} - 25 \, b^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} + 2976 \, a b \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} - 270 \, a^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) + 165 \, b^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) + 736 \, a b\right )}}{{\left (\tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} + 1\right )}^{6}}}{240 \, d} \]

[In]

integrate(cos(d*x+c)^6*csc(d*x+c)^2*(a+b*sin(d*x+c))^2,x, algorithm="giac")

[Out]

1/240*(480*a*b*log(abs(tan(1/2*d*x + 1/2*c))) + 120*a^2*tan(1/2*d*x + 1/2*c) - 75*(6*a^2 - b^2)*(d*x + c) - 12
0*(4*a*b*tan(1/2*d*x + 1/2*c) + a^2)/tan(1/2*d*x + 1/2*c) + 2*(270*a^2*tan(1/2*d*x + 1/2*c)^11 - 165*b^2*tan(1
/2*d*x + 1/2*c)^11 + 1440*a*b*tan(1/2*d*x + 1/2*c)^10 + 570*a^2*tan(1/2*d*x + 1/2*c)^9 + 25*b^2*tan(1/2*d*x +
1/2*c)^9 + 4320*a*b*tan(1/2*d*x + 1/2*c)^8 + 300*a^2*tan(1/2*d*x + 1/2*c)^7 - 450*b^2*tan(1/2*d*x + 1/2*c)^7 +
 7360*a*b*tan(1/2*d*x + 1/2*c)^6 - 300*a^2*tan(1/2*d*x + 1/2*c)^5 + 450*b^2*tan(1/2*d*x + 1/2*c)^5 + 6720*a*b*
tan(1/2*d*x + 1/2*c)^4 - 570*a^2*tan(1/2*d*x + 1/2*c)^3 - 25*b^2*tan(1/2*d*x + 1/2*c)^3 + 2976*a*b*tan(1/2*d*x
 + 1/2*c)^2 - 270*a^2*tan(1/2*d*x + 1/2*c) + 165*b^2*tan(1/2*d*x + 1/2*c) + 736*a*b)/(tan(1/2*d*x + 1/2*c)^2 +
 1)^6)/d

Mupad [B] (verification not implemented)

Time = 12.08 (sec) , antiderivative size = 683, normalized size of antiderivative = 3.84 \[ \int \cos ^4(c+d x) \cot ^2(c+d x) (a+b \sin (c+d x))^2 \, dx=\text {Too large to display} \]

[In]

int((cos(c + d*x)^6*(a + b*sin(c + d*x))^2)/sin(c + d*x)^2,x)

[Out]

(tan(c/2 + (d*x)/2)^10*((7*a^2)/2 + (5*b^2)/12) - tan(c/2 + (d*x)/2)^8*(10*a^2 + (15*b^2)/2) + tan(c/2 + (d*x)
/2)^12*((7*a^2)/2 - (11*b^2)/4) - tan(c/2 + (d*x)/2)^2*((21*a^2)/2 - (11*b^2)/4) - tan(c/2 + (d*x)/2)^6*(25*a^
2 - (15*b^2)/2) - tan(c/2 + (d*x)/2)^4*((49*a^2)/2 + (5*b^2)/12) - a^2 + (248*a*b*tan(c/2 + (d*x)/2)^3)/5 + 11
2*a*b*tan(c/2 + (d*x)/2)^5 + (368*a*b*tan(c/2 + (d*x)/2)^7)/3 + 72*a*b*tan(c/2 + (d*x)/2)^9 + 24*a*b*tan(c/2 +
 (d*x)/2)^11 + (184*a*b*tan(c/2 + (d*x)/2))/15)/(d*(2*tan(c/2 + (d*x)/2) + 12*tan(c/2 + (d*x)/2)^3 + 30*tan(c/
2 + (d*x)/2)^5 + 40*tan(c/2 + (d*x)/2)^7 + 30*tan(c/2 + (d*x)/2)^9 + 12*tan(c/2 + (d*x)/2)^11 + 2*tan(c/2 + (d
*x)/2)^13)) + (a^2*tan(c/2 + (d*x)/2))/(2*d) - (atan((((a^2*15i)/8 - (b^2*5i)/16)*((5*b^2)/8 - (15*a^2)/4 + 6*
tan(c/2 + (d*x)/2)*((a^2*15i)/8 - (b^2*5i)/16) + 4*a*b*tan(c/2 + (d*x)/2))*1i - ((a^2*15i)/8 - (b^2*5i)/16)*((
15*a^2)/4 - (5*b^2)/8 + 6*tan(c/2 + (d*x)/2)*((a^2*15i)/8 - (b^2*5i)/16) - 4*a*b*tan(c/2 + (d*x)/2))*1i)/(((a^
2*15i)/8 - (b^2*5i)/16)*((5*b^2)/8 - (15*a^2)/4 + 6*tan(c/2 + (d*x)/2)*((a^2*15i)/8 - (b^2*5i)/16) + 4*a*b*tan
(c/2 + (d*x)/2)) + ((a^2*15i)/8 - (b^2*5i)/16)*((15*a^2)/4 - (5*b^2)/8 + 6*tan(c/2 + (d*x)/2)*((a^2*15i)/8 - (
b^2*5i)/16) - 4*a*b*tan(c/2 + (d*x)/2)) + (5*a*b^3)/2 - 15*a^3*b + 2*tan(c/2 + (d*x)/2)*((225*a^4)/16 + (25*b^
4)/64 - (75*a^2*b^2)/16)))*((15*a^2)/4 - (5*b^2)/8))/d + (2*a*b*log(tan(c/2 + (d*x)/2)))/d